﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;

namespace HRM.Migrator
{
    public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory<HRMDbContext>
    {
        //ApplicationDbContext 代表的是你的创建失败的那个类型
        public HRMDbContext CreateDbContext(string[] args)
        {
            var builder = new DbContextOptionsBuilder<HRMDbContext>();
            builder.UseSqlServer(ConfigurationHelper.Get("MSSQLConnection"));
            return new HRMDbContext(builder.Options);
        }
    }

}
